<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>


<%--
  Created by IntelliJ IDEA.
  User: Doraemon
  Date: 2022/5/21
  Time: 9:41
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>地址展示页面</title>
    <link href="https://cdn.staticfile.org/twitter-bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet">
</head>
<body>
<div class="container">
    <div class="row clearfix">
        <div class="col-md-12 colum">
            <div class="page-header">
                <h1>
                    <small>地址簿————————显示所有地址</small>
                </h1>
            </div>
            <div class="row">
                <div class="col-md-4 column">
                    <a class="btn btn-primary" href="${pageContext.request.contextPath}/AddressBook/toInsert">新增地址</a>
                </div>
                <div class="col-md-4-colum">
                    <form action="" method="" style="float: right">
                        <input type="text">
                    </form>
                </div>
            </div>
        </div>
        <div class="row clearfix">
            <div class="col-md-12 column">
                <table class="table table-hover table-striped">
                    <thead>
                    <tr>
                        <th>用户名</th>
                        <th>联系人编号</th>
                        <th>姓名</th>
                        <th>电话</th>
                        <th>单位地址</th>
                        <th>邮箱1</th>
                        <th>邮箱2</th>
                        <th>邮箱3</th>
                    </tr>
                    </thead>
                    <tbody>
                    <c:forEach var="addressBook" items="${list}">
                        <tr>
                            <td>${addressBook.username}</td>
                            <td>${addressBook.contactId}</td>
                            <td>${addressBook.name}</td>
                            <td>${addressBook.phone}</td>
                            <td>${addressBook.address}</td>
                            <td>${addressBook.email1}</td>
                            <td>${addressBook.email2}</td>
                            <td>${addressBook.email3}</td>
                            <th>
                                <a href="${pageContext.request.contextPath}/AddressBook/toUpdate?contactId=${addressBook.contactId}">修改</a>
                                &nbsp;| &nbsp;
                                <a href="${pageContext.request.contextPath}/AddressBook/delete?contactId=${addressBook.contactId}">删除</a>
                            </th>
                        </tr>
                    </c:forEach>
                    </tbody>
                </table>
            </div>
        </div>

    </div>
</div>

</body>
</html>